/*******************************************************************************
*
*   FILE NAME:
*       GameTime.cpp - GameTime class implementation
*
*   DESCRIPTION:
*       Snapshot of the game timing state expressed in values that can be used
*       by variable-step (real time) or fixed-step (game time) games.
*
*******************************************************************************/
#include "GameTime.h"

GameTime::GameTime( void )
    : mElapsedTime( 0 ),
      mRunningSlowly( FALSE ),
      mTotalTime( 0 )
{
}

GameTime::GameTime( const TimeSpan& elapsed_time, boolean running_slowly, const TimeSpan& total_time )
    : mElapsedTime( elapsed_time ),
      mRunningSlowly( running_slowly ),
      mTotalTime( total_time )
{
}

GameTime::GameTime( const GameTime& other )
    : mElapsedTime( other.mElapsedTime ),
      mRunningSlowly( other.mRunningSlowly ),
      mTotalTime( other.mTotalTime )
{
}

GameTime::~GameTime( void )
{
}

GameTime& GameTime::operator=( const GameTime& other )
{
    mElapsedTime = other.mElapsedTime;
    mRunningSlowly = other.mRunningSlowly;
    mTotalTime = other.mTotalTime;
    return *this;
}

TimeSpan GameTime::GetElapsedTime( void ) const
{
    return mElapsedTime;
}

boolean GameTime::IsRunningSlowly( void ) const
{
    return mRunningSlowly;
}

TimeSpan GameTime::GetTotalTime( void ) const
{
    return mTotalTime;
}

void GameTime::SetElapsedTime( const TimeSpan& elapsed_time )
{
    mElapsedTime = elapsed_time;
}

void GameTime::SetRunningSlowly( boolean running_slowly )
{
    mRunningSlowly = running_slowly;
}

void GameTime::SetTotalTime( const TimeSpan& total_time )
{
    mTotalTime = total_time;
}
